import { userBaseInfoAPI } from '@/api'
// import { setUserInfo, getUserInfo } from '@/plugins/local_info'
export default {
  namespaced: true,
  state: {
    baseInfo: {}
  },
  mutations: {
    BASE_INFO(state, baseInfo) {
      state.baseInfo = baseInfo
    }
  },
  actions: {
    async getUserBaseInfo(context, userId) {
      try {
        const res = await userBaseInfoAPI(userId)
        context.commit('BASE_INFO', res.data)
        return Promise.resolve(res)
      } catch (error) {
        return Promise.reject(error)
      }
    }
  }
}
